//
//  Alumno.m
//  MasterUabApp
//
//  Created by Alumne on 13/10/13.
//  Copyright (c) 2013 Owlab. All rights reserved.
//


//----IMPORTS-->
#import "Alumno.h"
#import "SyncHandlerCountAlumnos.h"
#import "SyncHandlerGetAlumnos.h"
#import "SyncHandlerGetAsignaturas.h"
#import "SyncHandlerUpdateAlumno.h"
#import "SyncHandlerGetAlumnoInfo.h"
//<-------------

//-------CLASS AlumnoArray:
@implementation AlumnoArray


- (id) init:(id<SyncHandlerDelegate>)del
{
    self = [super init:del];
    if (self)
    {
        self.arrayAlumnos       = [[NSMutableArray alloc] init];
        self.arrayAsignaturas   = [[NSMutableArray alloc] init];
    }
    return self;
}

- (void) getCountAlumnos
{
    SyncHandlerCountAlumnos *handler = [[SyncHandlerCountAlumnos alloc] init:self];
    [handler start];
}

- (void) getAlumnos
{
    SyncHandlerGetAlumnos *handler = [[SyncHandlerGetAlumnos alloc] init:self];
    [handler start];
}

- (void) getAsignaturas:(NSString*)_alumnoID
{
    SyncHandlerGetAsignaturas *handler = [[SyncHandlerGetAsignaturas alloc] init:self];
    handler.AlumnoID = _alumnoID;
    [handler start];
}

- (void) getAlumnoInfo:(NSString*)_alumnoID
{
    SyncHandlerGetAlumnoInfo *handler = [[SyncHandlerGetAlumnoInfo alloc]init:self];
    handler.AlumnoID = _alumnoID;
    [handler start];
}

- (void) updateAlumno:(NSString*)_alumnoID andNombre:(NSString*)_nombre andApellidos:(NSString*)_apellidos andNIF:(NSString*)_nif
{
    SyncHandlerUpdateAlumno *handler = [[SyncHandlerUpdateAlumno alloc]init:self];
    handler.AlumnoID        = _alumnoID;
    handler.AlumnoNombre    = _nombre;
    handler.AlumnoApellidos = _apellidos;
    handler.AlumnoNIF       = _nif;
    [handler start];
}

@end



//--------CLASS ALUMNO:
@implementation Alumno


//--Properties:
@synthesize AlumnoId;
@synthesize AlumnoNombre;
@synthesize AlumnoApellidos;
@synthesize AlumnoNIF;
@synthesize AlumnoFoto;

@end



//--------CLASS ASIGNATURA:
@implementation Asignatura

//--Properties:
@synthesize AsignaturaNombre;
@synthesize AsignaturaId;
@synthesize AsignaturaCreditos;

@end
